module.exports = function ($resource, $state, $http, $q, FileUploader, toaster, $modal) {
  
    return {
  
      restrict: 'AE',
      template: require('../views/enterprisenotaduit.html'),
      replace: true,
      scope: {
        'saleobj': '=',
        'funobj': '=',
        'baseinfo': '=',
        'util': '=',
      },
      link: function (scope, elements, attrs) {
         /* 分页
        * ========================================= */
        scope.maxSize = 5;             //最多显示多少个按钮
        scope.bigCurrentPage = 1;      //当前页码
        scope.itemsPerPage = 10         //每页显示几条
        scope.searchform = {};
        scope.searchform = {};
        scope.getlist = function(){
          var para = {
            pageNo:scope.bigCurrentPage, 
            pageSize:scope.itemsPerPage,
          };
          $resource('/api/as/ggc/touristFoundsCheckUser/findUserInfoList', {}, {}).
          save(para,function (res) {
              if (res.errcode != 0) {
                  toaster.success({title:"",body:res.errmsg});
                  return;
              }
              console.log(res);
              scope.objs = res.data.results;
              scope.bigTotalItems = res.data.totalRecord;
              // scope.objs.forEach(function(element) {
              //     element.isSelected = element.state=='1'?true:false;
              // }, this);
          }); 
        }
        scope.getlist();
        // 详情
        scope.detail = function(user_code){
          alert('11');
          var modalInstance = $modal.open({
            template: require('../views/enterpriseDetail.html'),
            controller: 'enterpriseDetail',
            size: 'lg',
            resolve: {
              user_code: function () {
                return user_code;
              }
            }
          });
          modalInstance.result.then(function (showResult) {	
              scope.getlist();
          });
        }
        // 通过
        scope.agree = function(){
          
        }
        // 驳回
        scope.disagree = function(){
          
        }
      }
    }
  }